﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using InfoReaderLib.Info;
using Windows.Foundation;

namespace InfoReaderLib.Parser
{
    public interface IParser
    {
        /// <summary>
        /// Parser setting in JSON
        /// </summary>
        string SettingJSON { get; set; }

        /// <summary>
        /// Data source information
        /// </summary>
        IInfoSource DataSource { get; set; }

        /// <summary>
        /// The universal parse function to be called by reader
        /// </summary>
        /// <returns>List or detail</returns>
        IAsyncOperation<IInfo> Parse();

        /// <summary>
        /// Parse detail page, but can also return list
        /// </summary>
        /// <param name="detailSource">Contains Url to be used to obtain detail page</param>
        /// <returns></returns>
        IAsyncOperation<IInfo> Parse(IInfoDetail detailSource);
    }
}
